﻿using System;
using System.Collections;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using GameStateManagement;
using System.Threading;

namespace DrWileyO_REDACTED_Adventure.Screens
{
    class InstructionsScreen : GameScreen
    {
        public InstructionsScreen()
        {
        }

        public override void Activate(bool instancePreserved)
        {
            if (!instancePreserved)
            {

            }
        }

        public override void Update(GameTime gameTime, bool otherScreenHasFocus,
                                                 bool coveredByOtherScreen)
        {
            KeyboardState state = Keyboard.GetState();
            if (state.IsKeyDown(Keys.Space) || state.IsKeyDown(Keys.Escape))
            {
                LoadingScreen.Load(ScreenManager, true, PlayerIndex.One,
                                   new MainMenuScreen());
            }
        }

        public override void Draw(GameTime gameTime)
        {
            SpriteBatch sBatch = ScreenManager.SpriteBatch;
            ScreenManager.GraphicsDevice.Clear(ClearOptions.Target,
                                                Color.Black, 0, 0);
            ContentManager content = new ContentManager(ScreenManager.Game.Services, "Content");

            SpriteFont font = content.Load<SpriteFont>("MenuEntryFont");
            sBatch.Begin();

            sBatch.DrawString(font, "Use WASD to move!", new Vector2(20, 20), Color.White);
            sBatch.DrawString(font, "Use W to jump!", new Vector2(20, 45), Color.White);
            sBatch.DrawString(font, "Use Space to shrink!", new Vector2(20, 70), Color.White);
            sBatch.DrawString(font, "Collect all of the potions to win!", new Vector2(20, 95), Color.White);
            sBatch.DrawString(font, "Don't get caught in small places!", new Vector2(20, 120), Color.White);
            sBatch.DrawString(font, "You're constantly growing!", new Vector2(20, 145), Color.White);
            sBatch.DrawString(font, "Don't fall down!", new Vector2(20, 170), Color.White);
            sBatch.DrawString(font, "Watch your energy!", new Vector2(20, 195), Color.White);
            sBatch.DrawString(font, "You jump shorter when you're small!", new Vector2(20, 220), Color.White);

            sBatch.End();
        }
    }
}
